/**
* @Author:wjp
* @Date:2021/1/25 1:25 下午
 */
package xerr

var message map[int]string

func init() {
	message = make(map[int]string)
	message[OK] = "SUCCESS"
	message[USER_QUERY_ERROR] = "用户不存在"
	message[IM_SDK_SERISON_NO] = "客户端版本不对，需升级sdk"
	message[IM_BAN_AND_SEAL] = "被封禁"
	message[IM_USER_PWD_FAIL] = "用户名或密码错误"
	message[IM_IP_BAN] = "IP限制"
	message[IM_LLLEGAL_OPERATION] = "非法操作,或没有权限"
	message[IM_CLASS_NO] = "对象不存在"
	message[IM_PARAMETER_NO_LONG] = "参数长度过长"
	message[IM_CLIENT_TIMEOUT] = "客户端请求超时"
	message[IM_SMS_CODE] = "短信验证失败"
	message[IM_PARAMETER_ERROR] = "参数错误"
	message[IM_ACCOUNT_DISABLE] = "频率控制"
	message[IM_FREQUENCY_CONTROL] = "账号禁用"
	message[IM_FORBIDDEN_SPEECH] = "禁言"
	message[IM_HTTP_REPEAT_REQUEST] = "http重复请求"
	message[IM_SERVICE_FAIL] = "服务器内部错误"
	message[IM_SERVICE_NO] = "服务不可用"
	message[PARAMETER_ERR]="参数错误"
	message[USER_NO_ERROR]="此账户不存在"
	message[DB_DELETE_ERR]="删除失败"
	message[USER_TOKEN_ERROR]="token错误"
	message[USER_PASSWORD_ERROR]="密码错误"
}

func NMapErrMsg(errcode int) string {
	if msg, ok := message[errcode]; ok {
		return msg
	} else {
		return "服务器繁忙,请稍后再试"
	}
}
